package com.itfreer.knowledge.dao.config;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import org.springframework.beans.BeanUtils;

import com.itfreer.form.api.JdbcBaseEntity;
import com.itfreer.knowledge.entity.config.LabelEntity;

@Entity(name = "knowledge_label")
public class JdbcLabelEntity implements JdbcBaseEntity<LabelEntity>, Serializable {

	private static final long serialVersionUID = -7040201788965745098L;

	/**
	 * id值，主键，唯一值
	 * 系统应用中必需关联此值
	 */
	@Id
	@Column(name = "id", length = 50, nullable = false)
	private String id;
	
	/**
	 * 站点名称
	 */
	@Column(name = "s_siteid", length = 20, nullable = true)
	private String siteId;
	
	/**
	 * 网站名称
	 */
	@Column(name = "s_labelName", length = 50, nullable = false)
	private String labelName;

	/**
	 * 推荐
	 */
	@Column(name = "b_recommend", length = 10, nullable = true)
	private Boolean recommend;

	/**
	 * 状态
	 */
	@Column(name = "s_state", length = 10, nullable = true)
	private String state;
	
	@Column(name = "i_order", nullable = true)
	private Integer order;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getLabelName() {
		return labelName;
	}

	public void setLabelName(String linkName) {
		this.labelName = linkName;
	}

	public Boolean getRecommend() {
		return recommend;
	}

	public void setRecommend(Boolean recommend) {
		this.recommend = recommend;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	public String getSiteId() {
		return siteId;
	}

	public void setSiteId(String siteId) {
		this.siteId = siteId;
	}
	
	public Integer getOrder() {
		return order;
	}

	public void setOrder(Integer order) {
		this.order = order;
	}

	@Override
	public void from(LabelEntity t) {
		BeanUtils.copyProperties(t, this);
	}

	@Override
	public LabelEntity toEntity() {
		LabelEntity toEntity = new LabelEntity();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}
}